const mongoose = require("mongoose")
const crypto = require("crypto") //引用加密模块
const ObjectId = mongoose.Schema.Types.ObjectId;
const ShoppingSchema = new mongoose.Schema({
    // 购物车
    name: String, //商品名字
    price: String, //商品价格
    imgurl: String, //商品图片
    num: String, //商品总价
    number: Number //记录购物数量
}, {
        versionKey: false,
        timestamps: {
            createdAt: 'createTime',
            updatedAt: 'updateTime'
        } //自动管理修改时间
    })
const shopping = mongoose.model("shopping", ShoppingSchema);

module.exports = shopping;